package Draw;

import Chess.BorderPane;
import javafx.scene.paint.Color;

public class blackKing {
	public void blackking(int x,int y,int[][] chess){
		int cellent = 90;
		Color color = new Color(0,0,0,0.5);
		try{
		if(chess[y][x+1]!=2){
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect((x+1)*cellent, y*cellent, cellent, cellent);
		}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y][x-1]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect((x-1)*cellent, y*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y+1][x]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect(x*cellent, (y+1)*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y-1][x]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect(x*cellent, (y-1)*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y+1][x+1]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect((x+1)*cellent, (y+1)*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y+1][x-1]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect((x-1)*cellent, (y+1)*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y-1][x-1]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect((x-1)*cellent, (y-1)*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
		try{
			if(chess[y-1][x+1]!=2){
				BorderPane.gc.setFill(color);
				BorderPane.gc.fillRect((x+1)*cellent, (y-1)*cellent, cellent, cellent);
			}
		}catch(Exception ex){
			
		}
		
	}
}
